<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:p="http://primefaces.org/ui">

    <h:head>
        <title>Retailshop - Main</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

        <link rel="stylesheet" type="text/css" href="recursos/css/backoffice.css"/>
    </h:head>

    <h:body>
        <p:layout id="solveBug" rendered="false" >
            <p:layoutUnit position="center" visible="false">
            </p:layoutUnit>
        </p:layout>

        <div id="bc_header">
            <ui:insert name="bc_header">
                <ui:include src="backoffice/bc_header.xhtml" />
            </ui:insert>
        </div>
        <div id="bc_body">
            <div id="bc_content">
                <ui:insert name="bc_content">
                    <c:choose>
                        <c:when test="#{backofficeControllerBean.checkUsers(sessionScope.bc_nextView)}">
                            <ui:include src="backoffice/bc_users.xhtml" />
                        </c:when>
                        <c:when test="#{backofficeControllerBean.checkItems(sessionScope.bc_nextView)}">
                            <ui:include src="backoffice/bc_items.xhtml" />
                        </c:when>
                        <c:when test="#{backofficeControllerBean.checkUser(sessionScope.bc_nextView)}">
                            <ui:include src="backoffice/bc_user.xhtml" />
                        </c:when>
                        <c:when test="#{backofficeControllerBean.checkItem(sessionScope.bc_nextView)}">
                            <ui:include src="backoffice/bc_item.xhtml" />
                        </c:when>
                        <c:when test="#{backofficeControllerBean.checkNewItem(sessionScope.bc_nextView)}">
                            <ui:include src="backoffice/bc_new_item.xhtml" />
                        </c:when>
                        <c:when test="#{backofficeControllerBean.checkCategories(sessionScope.bc_nextView)}">
                            <ui:include src="backoffice/bc_categories.xhtml" />
                        </c:when>
                        <c:otherwise>
                            <!-- repetimos bc_user.xml por si pordefecto se quiere mostrar una pagina de estadisticas para los administradores que sea facil cambiar-->
                            <ui:include src="backoffice/bc_users.xhtml" />
                        </c:otherwise>
                    </c:choose>


                </ui:insert>
            </div>
        </div>
    </h:body>

</html>